UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QgoKWVFrjGvyS+JCNkSIwOuXMZPGvHJ4bNVKX+XX2eM=' 
WHERE 
  key_id = '879077bc82263a1b15c1b2a77ea9aa9df80f3c6ab08af90c020f06f0cf7ceba0' 
  AND (
    token = 'QgoKWVFrjGvyS+JCNkSIwOuXMZPGvHJ4bNVKX+XX2eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028