UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aox7cW+a13GN5Ig4QQCHz8hdcbQO8GrreguBIZoyX4Q=' 
WHERE 
  key_id = 'e3dad26d80f2a41a5bfc4ba74168f711de74ceac6cb15e2a735fd2e6cfa2c6bd' 
  AND (
    token = 'aox7cW+a13GN5Ig4QQCHz8hdcbQO8GrreguBIZoyX4Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045