UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xr4OFGpgy3wgXrhxDpXx8aIRW/Rr3y5nezLi2LmDPo=' 
WHERE 
  key_id = '179a1e97c6b26b195da75c53f814ec87d54dde8d3559c69f1758955f7696af9e' 
  AND (
    token = '1xr4OFGpgy3wgXrhxDpXx8aIRW/Rr3y5nezLi2LmDPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034