UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3yqjc8X6zCMrEnWSkPfZfzn1MT5zhH6fj5qSj4jQXYg=' 
WHERE 
  key_id = '09486f9470581506c7a7c5d93d1442e6c0eb12e54ceb192e206bc3deda2a26ed' 
  AND (
    token = '3yqjc8X6zCMrEnWSkPfZfzn1MT5zhH6fj5qSj4jQXYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037