UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cyu8wwo5bCY9TPZ5STN70+5rGLTIXK1LBcj2gDgrQE='
WHERE
key_id = '42f6a1dd6afdb4b124af0498a1f2d8887846c79c1fe736ee094ffdb52f959114'
AND (
token = '6cyu8wwo5bCY9TPZ5STN70+5rGLTIXK1LBcj2gDgrQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)