UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WLEIs2dQSc74Z/5ks2OIcOAydWtI5uVd5pNl90hr5z4=' 
WHERE 
  key_id = 'd26fa52e4db128c2c0e5b66bb6fb1449380966ec9d022fafff4794bb529d2055' 
  AND (
    token = 'WLEIs2dQSc74Z/5ks2OIcOAydWtI5uVd5pNl90hr5z4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028