UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PsPaefXWlfJtSVXvx/8dCbClatXDLGwR+8TwaAM6aIw='
WHERE
key_id = '11abca4b80aa03a084505bae8dd712c979cf24382c6e6f389ca6645d2e6a71c5'
AND (
token = 'PsPaefXWlfJtSVXvx/8dCbClatXDLGwR+8TwaAM6aIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)