UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xq4eFZKSo9ckzOM2eiDmC46e9jKGGnSyDVcihWvosPc=' 
WHERE 
  key_id = '0ccc6c3178023a203181e95238bc3279a6c9d3d340723fb771c30c0c826d7ae1' 
  AND (
    token = 'xq4eFZKSo9ckzOM2eiDmC46e9jKGGnSyDVcihWvosPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037