UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oy5ByrdgNMstGZ6xPL2z10gYfmMEKUOkpNeb1KyE4/s='
WHERE
key_id = 'df62e7caf4af594ff843a09d5ba1261fda7cf197f62d3ac0586a445f605992d2'
AND (
token = 'oy5ByrdgNMstGZ6xPL2z10gYfmMEKUOkpNeb1KyE4/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)