UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '73XiiJV3awcclgnssTQ8IiVlLGz9vk0Nsv3vTfUT7a8='
WHERE
key_id = '2a59afeb3fb8e2b9eb9a94f08e7c633506550c496b3ed5709a5d9b326798a414'
AND (
token = '73XiiJV3awcclgnssTQ8IiVlLGz9vk0Nsv3vTfUT7a8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)