UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94NPaJCKBftkrcZ81vE8U07TU43zrdZ07wHW3vabzIk=' 
WHERE 
  key_id = '0913b8f382bd36f7dd4ab86845f7df790681b1e443a58146763c2ccca72a764d' 
  AND (
    token = '94NPaJCKBftkrcZ81vE8U07TU43zrdZ07wHW3vabzIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029