UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z/JxzauB7+0MOm7eF6+aRsVPqnO/UVHjiMX2rMbPXac=' 
WHERE 
  key_id = '21eddd2646c6d21fa7048e71afa749cb387e0cd0644ca6409b2595a98f80b1ee' 
  AND (
    token = 'z/JxzauB7+0MOm7eF6+aRsVPqnO/UVHjiMX2rMbPXac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034