UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32BjLayJUOi6kCxDNzsmtmJsDq9fKc4NbsUL8gL6RP4='
WHERE
key_id = '46a30d7c223fa9ad98be4028c7bbce6d23f9b75f79b8f2f103a994459d831832'
AND (
token = '32BjLayJUOi6kCxDNzsmtmJsDq9fKc4NbsUL8gL6RP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)