UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/+jfNAmUh8Y4ecqBon+wSz5FVuUsEYNIr8STgSzKY0A='
WHERE
key_id = '0dec7733bb2b9f85ff28183674df9d37054468c94e0694289d5e941171a94189'
AND (
token = '/+jfNAmUh8Y4ecqBon+wSz5FVuUsEYNIr8STgSzKY0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)