UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Y3KPni2nYo6WmAmLmophYl8P6QLjzsifMZkMWX2v/4I=' 
WHERE 
  key_id = 'ef6f6a2643b686feb413a20b546a4473af66cacb27141d4a97449cf1e2517bbf' 
  AND (
    token = 'Y3KPni2nYo6WmAmLmophYl8P6QLjzsifMZkMWX2v/4I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032