UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Ogj+cEBhtmH0ij+8X2ujYItKhHnu2ICUVUoajegsPM=' 
WHERE 
  key_id = '4c19890b58b1d85b29b3d7fef7f3e669ffad93fe7d04722b23562047b7a55e3e' 
  AND (
    token = '7Ogj+cEBhtmH0ij+8X2ujYItKhHnu2ICUVUoajegsPM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021