UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h6Mvp50Vq7TB+W3ko2Udl0dBZECDZgWAGn1k27oJ1mI=' 
WHERE 
  key_id = '9d5c4722cb4e22132e9a53f159a23188c42d8b0f14085d7a706397ea828f0c8e' 
  AND (
    token = 'h6Mvp50Vq7TB+W3ko2Udl0dBZECDZgWAGn1k27oJ1mI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041