UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b9CzxtooM7wwTCvxZJwC806nj/qCBJW8Njhy7kg4N7I='
WHERE
key_id = '3d510abf5f362297590bfc1ffa153d9fbd587cdec7b1f15e37f3b2b55e9a2e74'
AND (
token = 'b9CzxtooM7wwTCvxZJwC806nj/qCBJW8Njhy7kg4N7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)