UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X0I/ckp7Kt/xNFx6EGxs0W/FJDwC+l7JrqnBQzQInbU=' 
WHERE 
  key_id = 'daeb03f52ecda0a2d432673ecb00be50c27dc6dc12e6d221fcfee1c916d14925' 
  AND (
    token = 'X0I/ckp7Kt/xNFx6EGxs0W/FJDwC+l7JrqnBQzQInbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031