UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k7VCZehthixufdH4kbGRc+xCmpDaAAPChNoZwhmdJLQ='
WHERE
key_id = 'f537cc2b4e5e77c3c1467da898588091a8889b217f9f63da9bc7da7950bb668e'
AND (
token = 'k7VCZehthixufdH4kbGRc+xCmpDaAAPChNoZwhmdJLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)