UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QG1mefenzQcCIXAe5OR+ASGDAVuVxx6bGCOw4wEv6g4=' 
WHERE 
  key_id = '568cb7e7f431c94a5724ddb0b57f1e0a493cb6d27627046b50017ae184361658' 
  AND (
    token = 'QG1mefenzQcCIXAe5OR+ASGDAVuVxx6bGCOw4wEv6g4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027