UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JBeebfBJ/mJfSz0vRt63h044tLWk2G8YtThfz47hhwM=' 
WHERE 
  key_id = '6629b0c15bbf467b100f98d99cfc2a5cd4f0d19e22b82fab0ebf7414e5e55ff7' 
  AND (
    token = 'JBeebfBJ/mJfSz0vRt63h044tLWk2G8YtThfz47hhwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051