UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's4i8BsXArePJCScjUBnae00ah80F0aUjMiEZEZRNQoc='
WHERE
key_id = 'cf49d4a61fa4e41df5cd88ba8efe05054344854fc58928b434406bc90b59af6a'
AND (
token = 's4i8BsXArePJCScjUBnae00ah80F0aUjMiEZEZRNQoc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)