UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CDRDfEa1I9HgYpiaMzNjSaNNXz4r9eQzP9bLH5GUkCU=' 
WHERE 
  key_id = '55db7912846e1064a3ba363097350de8cc1d0f73d94b7b4e64482e59f26b8f68' 
  AND (
    token = 'CDRDfEa1I9HgYpiaMzNjSaNNXz4r9eQzP9bLH5GUkCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034