UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j2LE8zborMNemVfvpIyu0BwZUoVBizNcxbwpdpnDYig=' 
WHERE 
  key_id = '53c1caa43d4e418c91ed941cc0a29b42713e10401e9b605aea7590d58eeb63b2' 
  AND (
    token = 'j2LE8zborMNemVfvpIyu0BwZUoVBizNcxbwpdpnDYig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035