UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7W70NRvp2MJBjrhhZZz+m8xd/YgqtATAg9LS+jc+Tgk=' 
WHERE 
  key_id = 'e1d344539535ef38e73e588f24b0b45bd8d0f9a009d381ca9be76e8a5e51ec42' 
  AND (
    token = '7W70NRvp2MJBjrhhZZz+m8xd/YgqtATAg9LS+jc+Tgk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027