UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HDJcp6jAaxJp8I56pCSfYZUm6cadh4Z2VQerqJ5ZKVQ='
WHERE
key_id = '1b3580045d1c65ef7b5f86562ac450e37aac15154c924d1932018bf6ba21482f'
AND (
token = 'HDJcp6jAaxJp8I56pCSfYZUm6cadh4Z2VQerqJ5ZKVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)