UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/Xh19AiP6/SlwN9P4Tz0sDOybVZ306cvNSYBUEdfHo=' 
WHERE 
  key_id = '3c023bf3782bd5ff78c017ecc0abdf8346c995ff65c00b07edafaf03df0bf87a' 
  AND (
    token = 'U/Xh19AiP6/SlwN9P4Tz0sDOybVZ306cvNSYBUEdfHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034