UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4/xG2eLju/cfTLjuW2/r4U79+T9Xa9U+TAb2gDsGfxU=' 
WHERE 
  key_id = '6477a4b123e54071f4121770d15767a53a9cedee247477fbe39db66672f7da63' 
  AND (
    token = '4/xG2eLju/cfTLjuW2/r4U79+T9Xa9U+TAb2gDsGfxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031