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