UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FFXVgNJxFdAFDph4XWryHk6kd4otFFHWgl/KfZjyj3c=' 
WHERE 
  key_id = '020b9aebc00d5385d9ef6d3416d225a0aa68fc801e0083746bfde88dbc2d255d' 
  AND (
    token = 'FFXVgNJxFdAFDph4XWryHk6kd4otFFHWgl/KfZjyj3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00148