UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IK4prJeb1kCsXwlR+9HDLTpHF4E4GB4gqMAiS/x2uxk=' 
WHERE 
  key_id = '3fe63bb741b4c98af5b90658cb82a22a21c9970cdce22f923991ee5a2cb48631' 
  AND (
    token = 'IK4prJeb1kCsXwlR+9HDLTpHF4E4GB4gqMAiS/x2uxk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038