UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'itcznJoDbDF/vljwZ2GQpkoPq0bUsn5O00NKAp5BAoo=' 
WHERE 
  key_id = '4f7c49a1321127a86381d54543da3483b68c438f5e1ca442ad1ac5e6a0656083' 
  AND (
    token = 'itcznJoDbDF/vljwZ2GQpkoPq0bUsn5O00NKAp5BAoo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036