UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b0TaOXUVFuhasH/hB9U0Xd3nG3S49A6Kl6BEpcKCWek=' 
WHERE 
  key_id = '081848379591f5ad42c2d172b368daf0fe4e510251343d3dfd8c919272005fe1' 
  AND (
    token = 'b0TaOXUVFuhasH/hB9U0Xd3nG3S49A6Kl6BEpcKCWek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041