UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ZvRYTyICwRPcfDzP5hAe4I/Kp2TKVvIoz54ULAEUOM=' 
WHERE 
  key_id = '09dc2f37bfd51fc640e583fe87f96ed7329b29b6629e58e386bacb6c7678ccc9' 
  AND (
    token = '0ZvRYTyICwRPcfDzP5hAe4I/Kp2TKVvIoz54ULAEUOM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047