UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FpWLll9G86amTvPBnZp64rAo1UlTtr7luEPug6Z0zmk=' 
WHERE 
  key_id = '1253d58f53c6d037de258a18aace9c727cf9f504094c37665be3796a46ec2a40' 
  AND (
    token = 'FpWLll9G86amTvPBnZp64rAo1UlTtr7luEPug6Z0zmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018