UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/bpU+An4I+f69bzdHbBtbpPZMxDkUr9c5tROJZn13Lk=' 
WHERE 
  key_id = '4b84c94a2d829afb1d4dca4e932ede3b63fb1651ca911d299790be13fc420523' 
  AND (
    token = '/bpU+An4I+f69bzdHbBtbpPZMxDkUr9c5tROJZn13Lk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058