UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HWR+bj3JJ0oyJnK0i42Gza7KqlBFRvM8uGXxE6ExAXU=' 
WHERE 
  key_id = '052b15b6a0f2ab3083be2a40678e6dbe5a2cfa0a4817a65d77ea4c2aa6f89462' 
  AND (
    token = 'HWR+bj3JJ0oyJnK0i42Gza7KqlBFRvM8uGXxE6ExAXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033