UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o6QW4OWCE9d11w2GWGginVBuIz47dMCDHZXRzqP1RGA=' 
WHERE 
  key_id = '81ce6e2d5ea27979194c00b144cc76444d000d8e6c7eee555bb0c570e402dd8f' 
  AND (
    token = 'o6QW4OWCE9d11w2GWGginVBuIz47dMCDHZXRzqP1RGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021