UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yFvrpUv3ANp0GGBcxuvHVpf5JGC2tVApNbIyzm/4Zyc='
WHERE
key_id = '21642fd1055bb8cff1b4aefba65755ab21f4c1ed3086cea932d258daec7e9b88'
AND (
token = 'yFvrpUv3ANp0GGBcxuvHVpf5JGC2tVApNbIyzm/4Zyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)