UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wb3G+Mbo1FvVxe/s5qRru2mhN65XuE8Ww5vnluG7bsg='
WHERE
key_id = 'e53316714cc289b5691898df256208990e59608fc62b9de9d9c7cf45556d6238'
AND (
token = 'Wb3G+Mbo1FvVxe/s5qRru2mhN65XuE8Ww5vnluG7bsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)