UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x8taIv7/f6wLukk/wtSTpvGJhnjyCwfaCISqvm4iFJs='
WHERE
key_id = '92e894b98a933968cbbb70b3eb36d2263da88d24abf88d65d2b51e5664a4b9b0'
AND (
token = 'x8taIv7/f6wLukk/wtSTpvGJhnjyCwfaCISqvm4iFJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)