UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+0q1xNsvXA2c5Oo6f1bh/WVDdaVS/j5PWCj1EPqFEgQ=' 
WHERE 
  key_id = '0c3b86fbf4d9ba17dda46b5dc6d1e51214df03003a08e2160b34343f316291bc' 
  AND (
    token = '+0q1xNsvXA2c5Oo6f1bh/WVDdaVS/j5PWCj1EPqFEgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026