UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x5L6DW/kUmwYvrdFn2508XXUxulL62OGs4q6/wwxqXA=' 
WHERE 
  key_id = '6bb7686dfc7f2fc2a49a2d431f1ab16e7a93b08c936f8ebfd1e42a4c61c17a82' 
  AND (
    token = 'x5L6DW/kUmwYvrdFn2508XXUxulL62OGs4q6/wwxqXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022