UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pZ0ZOmqX18TbkbLf/o4G9OKzkDt+bMIc1bNUQcMzboU=' 
WHERE 
  key_id = '0521c49468dbb2491443a7a354c27d8dd7c464783cd17d4526342f03b7dc4e7d' 
  AND (
    token = 'pZ0ZOmqX18TbkbLf/o4G9OKzkDt+bMIc1bNUQcMzboU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029